extends CharacterBody2D
class_name Bullet01

@export var speed = 100.0
@export var damage = 1.0


func setPos(pos):
	position = pos


func _physics_process(delta):
	velocity.y = -speed
	move_and_slide()
	
	if position.y <= -10:
		queue_free()


func _on_hit_area_area_entered(area:Area2D):
	if area.name == "BossHitArea":
		queue_free()
		area.onHit(damage)
	elif area.name == "FunnelHitArea":
		queue_free()
		area.onHit(damage)
	elif area.name == "BulletAutoTraceHitArea":
		queue_free()
		area.onHit(damage)
		
